home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Prg / STR2BMP.ZIP / STR2BMP.H < prev    next >
C/C++ Source or Header  |  1997-09-14  |  2KB  |  60 lines

  1. // Strbmp.h : Header file for VB string to bitmap conversion DLL.
  2. //
  3. //   Freeware -- Version 1.1   09/20/93
  4. //
  5. //   Written by Jorge Monasterio (CIS 72147, 2674)
  6. //
  7. //
  8.  
  9.  
  10. // Types
  11. //   The following types are used in the DLL.
  12. //       HLSTR -- Used to pass/return VB type strings.
  13. //       LPSTR -- Used to point to zero-terminated strings (internal).
  14. //       LONG -- Used to pass/return VB type integers.
  15. //       STRINGBMP -- A zero-terminated string containing header info + bmp data.
  16.  
  17. // DLL(Type) defines function return type as exported DLL function.
  18. #define DLL(t) extern "C" t FAR PASCAL _export
  19.  
  20. // Constants
  21. const WORD MAX_VB_STRING_LENGTH = 65000L;
  22.  
  23. const ILLEGAL_FUNCTION_CALL = 20005; // When string sizes don't match.
  24. const INVALID_PICTURE = 20481;  // When string doesn't contain bitmap.
  25. const OUT_OF_STRING_SPACE = 20014; // When picture too big for string.
  26.  
  27. // Header information stored in VB string for any converted BMP.
  28. const StringBmpIdentifier =  0x5342;  // = "SB"
  29. struct SB {
  30.    WORD identifier;      // Must be 'SB' = 0x5342
  31.    WORD width;           // Width in pixels of the image.
  32.    WORD height;          // Height in pixels of the image.
  33.    WORD widthbytes;      // Width in bytes of the image.
  34.  };
  35.  
  36. // In the VB string, store the above header then the data.
  37. union STRINGBMP
  38.  { struct SB FAR *stringbmp;    // Header.
  39.    LPSTR vbstring;          // Data.
  40.  }; 
  41.  
  42. // Function prototypes:
  43. DLL(HLSTR) BMPToString( HDC hdc, HBITMAP hImage);
  44. DLL(LONG) StringToBMP( LPSTR string, HDC hdcSrc, HBITMAP hbmpSrc);
  45. DLL(LONG) StringBMP_Compare( LPSTR A, LPSTR B);
  46. DLL(HLSTR) StringBMP_AND( LPSTR A, LPSTR B);
  47. DLL(HLSTR) StringBMP_OR( LPSTR A, LPSTR B);
  48. DLL(HLSTR) StringBMP_INVERT( LPSTR A);
  49. DLL(HLSTR) StringBMP_FILL( LPSTR A);
  50. DLL(LONG) BMP_GetSize( HBITMAP hImage);
  51.  
  52. // Local only -- should not be called from VB.
  53. DLL(void) ReturnVBError( WORD err, LPSTR msg);
  54. DLL(LONG) StringBMP_SetDimensions( LPSTR A, int w, int h, int wb);
  55. DLL(WORD) StringBMP_GetWidth( LPSTR A);
  56. DLL(WORD) StringBMP_GetWidthBytes( LPSTR A);
  57. DLL(WORD) StringBMP_GetHeight( LPSTR A);
  58. DLL(WORD) StringBMP_ValidateParameters( LPSTR A, LPSTR B);
  59. DLL(WORD) StringBMP_VerifyIdentifier( LPSTR A);
  60.